package com.eastfair.tag.entity;

import com.eastfair.annotation.base.SubjectTypeEnum;
import com.eastfair.mongocrud.component.ReplenishInfo;
import com.eastfair.tag.dto.TagResourceDTO;
import com.eastfair.tag.enumeration.TagResourceTypeEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.List;

/**
 * Date:2022/3/22
 * Time:10:20
 *
 * @author zjn
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Document(collection = "tag_target")
@ReplenishInfo(isReplenish = true)
public class TagTarget {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("id")
    @Id
    @ApiModelProperty(required = true)
    private String id;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("projectId")
    @ApiModelProperty(value = "项目id")
    private Long projectId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("exhibitionId")
    @ApiModelProperty(value = "展会id")
    private Long exhibitionId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("subjectType")
    @ApiModelProperty(value = "主体类型")
    private SubjectTypeEnum subjectType;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("subjectId")
    @ApiModelProperty(value = "主体id")
    private Long subjectId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("tagId")
    @ApiModelProperty(value = "标签id")
    private Long tagId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("tagName")
    @ApiModelProperty(value = "标签名称")
    private String tagName;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("tagEnName")
    @ApiModelProperty(value = "标签英文名称")
    private String tagEnName;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("tagResourceType")
    @ApiModelProperty(value = "挂接方式")
    private TagResourceTypeEnum tagResourceType;

    /**
     * 资源集合
     */
    @Transient
    @ApiModelProperty(value = "资源集合")
    List<TagResourceDTO> tagResourceDTOList;

    /**
     * 标签id集合
     */
    @Transient
    @ApiModelProperty(value = "标签id集合")
    private List<Long> tagIdList;

}
